package cn.itsource.controller;

import cn.itsource.bean.SearchMasterMessage;
import cn.itsource.bean.SearchMasterMsg;
import cn.itsource.query.SearchMasterQuery;
import cn.itsource.service.ISearchMasterMessageService;
import cn.itsource.util.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author : 张金铭
 * @description :
 * @create :2022-11-20 17:34:00
 */
@Slf4j
@RestController
@RequestMapping("/searchmaster")
public class SearchMasterMessageController {

    @Resource
    private ISearchMasterMessageService searchMasterMessageService;

    @PostMapping("/publish")
    public JsonResult sendMessage(@RequestBody SearchMasterMessage searchMasterMessage){

        return searchMasterMessageService.sendMessage(searchMasterMessage);
    }

    @PostMapping("/pagelist")
    public JsonResult getPage(@RequestBody SearchMasterQuery query){
        return searchMasterMessageService.getPage(query);
    }

    @PostMapping("/shenghe")
    public JsonResult pass(@RequestBody SearchMasterMsg msg, HttpServletRequest request){

        return searchMasterMessageService.pass(msg,request);
    }
}
